Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use run_pip of env in executor #2701

Merged
merged 1 commit into from
Jul 24, 2020
Merged

use run_pip of env in executor #2701

merged 1 commit into from
Jul 24, 2020

Conversation

jstriebel
Copy link
Contributor

This is a bug-fix for the current development branch and ensures to use the correct python executable.

Using run simply uses sys.prefix with a bin suffix, which is not necessarily the currently used python executable.

E.g. when linking a specific python version to a custom directory, using sys.prefix may point to the wrong python version:

  • /usr/bin/python2.7
  • /usr/bin/python3.6
  • /usr/bin/python is a symlink to 2.7
  • /usr/bin/local/python (or any other location) is a symlink to 3.6 which shadows the former symlink
    sys.prefix is /usr in this case, which is correct, but the python executable there points to the wrong version.

run_pip in the env fixes this already by using sys.executable, see https://github.com/python-poetry/poetry/blob/develop/poetry/utils/env.py#L964
This should be used in the executor as well.

Thanks for considering this change!

This ensures to use the correct python executable.
Using `run` simply uses `sys.prefix` with a bin suffix, which is not necessarily the currently used python executable.

E.g. when linking a specific python version to a custom directory, using `sys.prefix` may point to the wrong python version:
* /usr/bin/python2.7
* /usr/bin/python3.6
* /usr/bin/python is a symlink to 2.7
* /usr/bin/local/python (or any other location) is a symlink to 3.6 which shadows the former symlink
`sys.prefix` is `/usr` in this case, which is correct, but the `python` executable there points to the wrong version.

`run_pip` in the env fixes this already by using `sys.executable`, see https://github.com/python-poetry/poetry/blob/develop/poetry/utils/env.py#L964
This should be used in the executor as well.
@sdispater sdispater merged commit 4bc181b into python-poetry:develop Jul 24, 2020
sdispater pushed a commit that referenced this pull request Jul 24, 2020
This ensures to use the correct python executable.
Using `run` simply uses `sys.prefix` with a bin suffix, which is not necessarily the currently used python executable.

E.g. when linking a specific python version to a custom directory, using `sys.prefix` may point to the wrong python version:
* /usr/bin/python2.7
* /usr/bin/python3.6
* /usr/bin/python is a symlink to 2.7
* /usr/bin/local/python (or any other location) is a symlink to 3.6 which shadows the former symlink
`sys.prefix` is `/usr` in this case, which is correct, but the `python` executable there points to the wrong version.

`run_pip` in the env fixes this already by using `sys.executable`, see https://github.com/python-poetry/poetry/blob/develop/poetry/utils/env.py#L964
This should be used in the executor as well.
sdispater added a commit that referenced this pull request Jul 24, 2020
This ensures to use the correct python executable.
Using `run` simply uses `sys.prefix` with a bin suffix, which is not necessarily the currently used python executable.

E.g. when linking a specific python version to a custom directory, using `sys.prefix` may point to the wrong python version:
* /usr/bin/python2.7
* /usr/bin/python3.6
* /usr/bin/python is a symlink to 2.7
* /usr/bin/local/python (or any other location) is a symlink to 3.6 which shadows the former symlink
`sys.prefix` is `/usr` in this case, which is correct, but the `python` executable there points to the wrong version.

`run_pip` in the env fixes this already by using `sys.executable`, see https://github.com/python-poetry/poetry/blob/develop/poetry/utils/env.py#L964
This should be used in the executor as well.

Co-authored-by: Jonathan Striebel <jstriebel@users.noreply.github.com>
@jstriebel jstriebel deleted the patch-1 branch July 29, 2020 15:36
@jstriebel
Copy link
Contributor Author

@sdispater I was assuming that the new minor version would be on the develop branch, but it seems like it should be on master. I opened #2747 therefore, sorry for the confusion. If the develop branch is unused in the meantime, would you mind deleting it?

@abn
Copy link
Member

abn commented Jul 29, 2020

@sdispater I was assuming that the new minor version would be on the develop branch, but it seems like it should be on master. I opened #2747 therefore, sorry for the confusion. If the develop branch is unused in the meantime, would you mind deleting it?

@jstriebel this was already ported in #2714 the develop branch will be deleted once all the current pull requests to that branch are resolved.

Copy link

github-actions bot commented Mar 1, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants